package info.techgeek.labs.clone;

public class Order implements Cloneable {

	Item item;

	public Order(Item item) {
		super();
		this.item = item;
	}

	public Item getItem() {
		return item;
	}

	public void setItem(Item item) {
		this.item = item;
	}

	@Override
	public Object clone() {
		try {
			Order clonedOrder = (Order) super.clone();
			clonedOrder.setItem((Item) item.clone());
			return clonedOrder;

		} catch (CloneNotSupportedException e) {
			e.printStackTrace();
		}
		return null;
	}

}
